ioemu: prefix phy devices with /dev/
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Mar 2008 10:24:45 +0000 (10:24 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 25 Mar 2008 10:24:45 +0000 (10:24 +0000)
just like blkif.py's _parse_uname does for PV guests.  Closes bug #983.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/ioemu/xenstore.c

index 8ff396b09fe1d675b8d156140699051b98b17784..01ace34ada2d6923520e33efc0e63b46b4569528 100644 (file)
@@ -189,6 +189,13 @@ void xenstore_parse_domain_config(int hvm_domid)
             memmove(params, offset+1, strlen(offset+1)+1 );
             fprintf(logfile, "Strip off blktap sub-type prefix to %s\n", params); 
         }
+        /* Prefix with /dev/ if needed */
+        if (!strcmp(drv, "phy") && params[0] != '/') {
+            char *newparams = malloc(5 + strlen(params) + 1);
+            sprintf(newparams, "/dev/%s", params);
+            free(params);
+            params = newparams;
+        }
 
         /* 
          * check if device has a phantom vbd; the phantom is hooked